<%@page import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <style>
        .errors{
            font-weight: 700;
            color:red;
        }
    </style>
    <script>
        function clearErrors() {
           var errors = document.getElementsByClassName("errors");
            errors.innerHTML="";
        }
      function onclick() {
          clearErrors();
      }
    </script>
</head>
<body>
    <h2>用户登录</h2>
    <form action="<c:url value="/UserServlet" />" method="post">
        <input hidden="hidden" value="login" name="method">
        用户名：<input type="text" name="username" class="username" onclick="onclick"><br>
        密  码：<input type="password" name="password" class="password" onclick="onclick"><br>
                <span class="errors">${errors}</span><br>
              <input type="submit" value="提交">
    </form>

</body>
</html>